package y_2025.m05.d23;

public class PrintString1 extends Thread {
    private final String str;
    
    public PrintString1(String str) {
        this.str = str;
    }
    
    @Override
    public void run() {
        for (int i = 0; i < str.length(); i++) {
            System.out.println(Thread.currentThread().getName() + ": " + str.charAt(i));
            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
    }

    public static void main(String[] args) {
        new PrintString1("welcome!").start();
        new PrintString1("welcome!").start();
    }
}